/* Copyright (c) 2025 Beijing Semidrive Technology Corporation
 * SPDX-License-Identifier: Apache-2.0
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * @file  Lin_Irq.c
 * @brief Semidrive. AUTOSAR 4.3.1 MCAL Lin
 */

#ifdef __cplusplus
extern "C" {
#endif

#include "Lin_Irq.h"
#include "Lin_Ip.h"

#define LIN_START_SEC_CODE_FAST
#include "Lin_MemMap.h"

#define LIN_ISR(id) \
ISR(Lin_Irq##id##_Handle)\
{\
    uint32 numNodeID = Lin_HwGetNode(APB_UART##id##_BASE);\
    if (numNodeID < LIN_NUM_CHANNELS) {\
        Lin_TransmitCallBk(numNodeID);\
    }\
}
/* PRQA S 4461 20 */
LIN_ISR(1)
LIN_ISR(2)
LIN_ISR(3)
LIN_ISR(4)
LIN_ISR(5)
LIN_ISR(6)
LIN_ISR(7)
LIN_ISR(8)
LIN_ISR(9)
LIN_ISR(10)
LIN_ISR(11)
LIN_ISR(12)
LIN_ISR(13)
LIN_ISR(14)
LIN_ISR(15)
LIN_ISR(16)
LIN_ISR(17)
LIN_ISR(18)
LIN_ISR(19)
LIN_ISR(20)

#define LIN_STOP_SEC_CODE_FAST
#include "Lin_MemMap.h"

#ifdef __cplusplus
}
#endif
